package com.mgr.controller;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class LogoutController {

	@RequestMapping("logout")
	public ModelAndView Logout(HttpSession session) {
		if (session.getAttribute("user") != null){
			session.removeAttribute("user");
			session.removeAttribute("balance");
			session.removeAttribute("trans");
			session.removeAttribute("step1");
			session.removeAttribute("step2");
			session.removeAttribute("step3");
		}
		return new ModelAndView("login");
	}
}
